#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QTabWidget>
#include <QJsonArray>
#include "date.h"
#include "recv.h"

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE


class Widget : public QWidget {
    Q_OBJECT
    WorkerThread workerThread;

public:

    Widget(QWidget *parent = nullptr);
    ~Widget();
    void updateButtonColorForSpot(ParkingDate* spot);
    void updateWidgetColorForSpot(ParkingDate* spot);
    void navigationMarkerHiding();
    void updateParkingStatus(int no, const QString& plate);
    void updateParkingStatus(int no, const QString& license_plate_number, const QString& last_entry_time, const QString& time, int expense);
    void setupConnections() ;
    void on_dataReceived(const QByteArray &data);

private slots:


    void on_pushButtonA101_clicked();
    void on_pushButtonA102_clicked();
    void on_pushButtonA103_clicked();
    void on_pushButtonA104_clicked();
    void on_pushButtonA105_clicked();
    void on_pushButtonB101_clicked();
    void on_pushButtonB102_clicked();
    void on_pushButtonB103_clicked();
    void on_pushButtonB104_clicked();
    void on_pushButtonB105_clicked();
    void on_pushButtonC101_clicked();
    void on_pushButtonC102_clicked();
    void on_pushButtonC103_clicked();
    void on_pushButtonC104_clicked();
    void on_pushButtonC105_clicked();
    void on_pushButtonD101_clicked();
    void on_pushButtonD102_clicked();
    void on_pushButtonD103_clicked();
    void on_pushButtonD104_clicked();
    void on_pushButtonD105_clicked();
    void on_pushButtonA106_clicked();
    void on_pushButtonA107_clicked();
    void on_pushButtonA108_clicked();
    void on_pushButtonA109_clicked();
    void on_pushButtonA110_clicked();
    void on_pushButtonB106_clicked();
    void on_pushButtonB107_clicked();
    void on_pushButtonB108_clicked();
    void on_pushButtonB109_clicked();
    void on_pushButtonB110_clicked();
    void on_pushButtonC106_clicked();
    void on_pushButtonC107_clicked();
    void on_pushButtonC108_clicked();
    void on_pushButtonC109_clicked();
    void on_pushButtonC110_clicked();
    void on_pushButtonD106_clicked();
    void on_pushButtonD107_clicked();
    void on_pushButtonD108_clicked();
    void on_pushButtonD109_clicked();
    void on_pushButtonD110_clicked();
    void on_b1Button_clicked();
    void on_b2Button_clicked();
    void on_b3Button_clicked();
    void on_pushButtonA201_clicked();
    void on_pushButtonA202_clicked();
    void on_pushButtonA203_clicked();
    void on_pushButtonA204_clicked();
    void on_pushButtonA205_clicked();
    void on_pushButtonB201_clicked();
    void on_pushButtonB202_clicked();
    void on_pushButtonB203_clicked();
    void on_pushButtonB204_clicked();
    void on_pushButtonB205_clicked();
    void on_pushButtonC201_clicked();
    void on_pushButtonC202_clicked();
    void on_pushButtonC203_clicked();
    void on_pushButtonC204_clicked();
    void on_pushButtonC205_clicked();
    void on_pushButtonD201_clicked();
    void on_pushButtonD202_clicked();
    void on_pushButtonD203_clicked();
    void on_pushButtonD204_clicked();
    void on_pushButtonD205_clicked();
    void on_pushButtonA206_clicked();
    void on_pushButtonA207_clicked();
    void on_pushButtonA208_clicked();
    void on_pushButtonA209_clicked();
    void on_pushButtonA210_clicked();
    void on_pushButtonB206_clicked();
    void on_pushButtonB207_clicked();
    void on_pushButtonB208_clicked();
    void on_pushButtonB209_clicked();
    void on_pushButtonB210_clicked();
    void on_pushButtonC206_clicked();
    void on_pushButtonC207_clicked();
    void on_pushButtonC208_clicked();
    void on_pushButtonC209_clicked();
    void on_pushButtonC210_clicked();
    void on_pushButtonD206_clicked();
    void on_pushButtonD207_clicked();
    void on_pushButtonD208_clicked();
    void on_pushButtonD209_clicked();
    void on_pushButtonD210_clicked();
    void on_pushButtonA301_clicked();
    void on_pushButtonA302_clicked();
    void on_pushButtonA303_clicked();
    void on_pushButtonA304_clicked();
    void on_pushButtonA305_clicked();
    void on_pushButtonB301_clicked();
    void on_pushButtonB302_clicked();
    void on_pushButtonB303_clicked();
    void on_pushButtonB304_clicked();
    void on_pushButtonB305_clicked();
    void on_pushButtonC301_clicked();
    void on_pushButtonC302_clicked();
    void on_pushButtonC303_clicked();
    void on_pushButtonC304_clicked();
    void on_pushButtonC305_clicked();
    void on_pushButtonD301_clicked();
    void on_pushButtonD302_clicked();
    void on_pushButtonD303_clicked();
    void on_pushButtonD304_clicked();
    void on_pushButtonD305_clicked();
    void on_pushButtonA306_clicked();
    void on_pushButtonA307_clicked();
    void on_pushButtonA308_clicked();
    void on_pushButtonA309_clicked();
    void on_pushButtonA310_clicked();
    void on_pushButtonB306_clicked();
    void on_pushButtonB307_clicked();
    void on_pushButtonB308_clicked();
    void on_pushButtonB309_clicked();
    void on_pushButtonB310_clicked();
    void on_pushButtonC306_clicked();
    void on_pushButtonC307_clicked();
    void on_pushButtonC308_clicked();
    void on_pushButtonC309_clicked();
    void on_pushButtonC310_clicked();
    void on_pushButtonD306_clicked();
    void on_pushButtonD307_clicked();
    void on_pushButtonD308_clicked();
    void on_pushButtonD309_clicked();
    void on_pushButtonD310_clicked();
    void disableButton();
    void enableButton();

private:
    Ui::Widget *ui; // This is generated by Qt's uic tool from your .ui file
    QTimer *hideTimer; // Declare hideTimer as a private member
    QList<ParkingDate*> m_parkingSpots;

};

#endif // WIDGET_H
